package com.gmall.console.base;

import me.ahoo.cosid.provider.IdGeneratorProvider;

import javax.annotation.Resource;

/**
 * @description:
 * @author: Jone
 * @create: 2024-06-09
 */
public class GeneratorServiceImp implements IGeneratorService{

    @Resource
    private IdGeneratorProvider idGeneratorProvider;

    public static String ID_SEQUENCE = "sequence";
    public static String ID_SNOWFLAKE = "snowflakeId";

    @Override
    public Long getSeqId() {
        return idGeneratorProvider.get(ID_SEQUENCE).get().generate();
    }

    @Override
    public Long getUnSeqId() {
        return idGeneratorProvider.get(ID_SNOWFLAKE).get().generate();
    }
}
